/************************************************************
 * Copyright (c) 2010 Georg Fritzsche
 *
 * This project is licensed under the "New BSD License": 
 * http://www.opensource.org/licenses/bsd-license.php
 ***********************************************************/

#ifndef TRIGGER_FMOD_UTIL_H
#define TRIGGER_FMOD_UTIL_H

#include <stdexcept>
#include <fmod_errors.h>

#define FmodErrThrow(fmRes) if (fmRes != FMOD_OK) throw fmod_error(fmRes)

inline bool isFmodErr(FMOD_RESULT r) 
{
    return (r != FMOD_OK);
}

struct fmod_error : std::runtime_error
{
    fmod_error(FMOD_RESULT r) throw() : std::runtime_error(FMOD_ErrorString(r)) {}
};

#endif
